-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use uv-pre-commit to validate lockfile #6699
base: main
Are you sure you want to change the base?
Conversation
@@ -45,9 +45,6 @@ jobs: | |||
- name: Install utils/ dependencies | |||
run: uv pip install --system -r utils/requirements.txt | |||
|
|||
- name: Validate uv lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to have this check only in one place.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6699 +/- ##
=======================================
Coverage 78.00% 78.00%
=======================================
Files 563 563
Lines 41766 41766
=======================================
Hits 32574 32574
Misses 9192 9192 ☔ View full report in Codecov by Sentry. |
Hmm, this might be a problem, looks like
EDIT: Indeed, this is a known issue when using dynamic metadata (such as version in our case) in `pyproject.toml: astral-sh/uv-pre-commit#35 |
This might get resolved in next uv version: astral-sh/uv#10622 |
7583f79
to
aae9e94
Compare
c7189a8
to
3766c25
Compare
There are two big advantages here: 1. Devs to have to have uv installed globally 2. We control uv version automatically.
06bfeb3
to
7d77899
Compare
I notified the uv maintainers about the issue that blocks this PR and they already replied and it looks like it might not be difficult to fix. Other people are hitting the same issue as well so let wait a bit for the next release. astral-sh/uv#10689 |
The previous uv hook that checked whether uv lockfile is up-to-date required the developer to have uv installed. Using the official
uv-pre-commit
hook, this is no longer the case. The hook also updates the lock automatically, instead of just checking its status.Here's the output that I got when I bumped the mypy package in pyproject.toml
(the warning is a bit unfortunate interaction between uv and pre-commit, I opened astral-sh/uv-pre-commit#36 and asked if it could be hidden so that it is not confusing for devs)